package com.example.home.adapter.provider

import android.view.View
import android.widget.ImageView
import com.example.adapter.CommBindingAdapter
import com.example.home.R
import com.example.image.ImgLoader
import com.example.image.option.ImageOptions
import com.zhpan.bannerview.holder.ViewHolder

/**
 * BannerViewHolder
 * */

class BannerViewHolder : ViewHolder<String> {
    override fun getLayoutId(): Int = R.layout.item_home_banner_item_view

    override fun onBind(itemView: View, url: String, position: Int, size: Int) {
       var imageView= itemView.findViewById<ImageView>(R.id.iv_banner)

        if (!url.isNullOrEmpty()){
           ImgLoader.build().loadNetIntoImageView(itemView.context,url,imageView, ImageOptions.setCommonImage(true).build())
        }

    }
}